<div class="state module">
	<div id="state" contentEditable=true style="outline:0;"></div>
	<div class="tools">
		<ul class="opts pull-left">
			<li class="emotion"><a href="javascript:;" id="emotions">表情</a></li>
			<li class="img"><a href="javascript:insert_images()">图片</a></li>
		</ul>
		<button type="button" class="pull-right btn green" ng-click="addMessage(1)" style="margin-right:5px;">发表</button>
		<div class="clear"></div>
	</div>
</div>

<div class="state tabbable tabbable-custom">
	<ul class="nav nav-tabs">
		<li class="active"><a data-toggle="tab" href="#tab_friend" ng-click="loadMessage(0,1);">好友动态</a></li>
		<li class=""><a data-toggle="tab" href="#tab_my" ng-click="loadMessage(1,1);">我的说说</a></li>
		<li class=""><a data-toggle="tab" href="#tab_about" ng-click="loadMessage(2,1);">与我相关</a></li>
	</ul>
	<div class="tab-content">
		<!-- 好友动态 -->
		<div id="tab_friend" class="tab-pane active">
			<div class=" portfolio-text" ng-repeat="message in friend_messages.list">
				<img ng-src="{{message.sender_pic}}" alt="" class="user-pic">
				<div class="portfolio-text-info">
					<div class="msg">
						<a ui-sref="space({user_id:message.sender_id})" ng-bind="message.sender_name"></a>
						：{{message.content}}
					</div>

					<div class="bottom">
						<span class="pull-left time">
							 {{message.create_time | diffDate}} · 浏览 {{message.browse_num}} 次
						</span> 
						<span class="pull-right">
							<a href="javascript:;"  ng-click="toggleComment(message);" >评论({{message.comment_num}})</a> | 
							<a href="javascript:;" id="a_vote{{message.id}}"  ng-click="vote(message,user.id);" >赞({{message.vote_num}})</a>
						</span>
					</div>
					<div class="clear"></div>
					<div id="collapse_{{message.id}}" class="comment">
						<!-- 评论编辑框 -->
						<div class="comment-editable" id="msg{{message.id}}">
							<div class="editable" aria-label="写下你的评论…"  contenteditable="true" id="friend_comment_editable{{message.id}}"></div>
							<div style="margin:2px 5px 0px 0px">
								<button class="btn green mini pull-right" ng-click="addComment(message,'friend_comment_editable')">提交</button>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="comment-list" ng-repeat="comment in message.comments">
							<img ng-src="{{comment.sender_pic}}" alt="" class="user-pic pull-left">
							<div style="overflow:hidden;">
								<div class="comment-content">
									<a ui-sref="space({user_id:comment.sender_id})" target="_blank" ng-bind="comment.sender_name"></a>
									<span ng-if="comment.sender_id!=comment.receiver_id">
										@ <a ui-sref="space({user_id:comment.receiver_id})" target="_blank" ng-bind="comment.receiver_name"></a>
									</span>
									<br>
									<span ng-bind="comment.content"></span>
								</div>
								<div class="comment-opts">
									<span class="pull-left time">
										{{comment.create_time | diffDate}}
									</span>
									<span class="pull-right">
										<a href="javascript:;" ng-click="toggleReply(comment,message);" >[回复]</a> 
									</span>
									<!-- 回复编辑框 -->
									<div id="friend_reply_{{comment.id}}" class="comment" style="margin-top:25px;" >
										<div class="comment-editable">
											<div class="editable" aria-label="写下你的评论…"  contenteditable="true" id="friend_reply_editable{{comment.id}}"></div>
											<div style="margin:2px 5px 0px 0px">
												<button class="btn green mini pull-right" ng-click="addReply(message,comment,user.id,'friend_reply_editable')">回复</button>
											</div>
											<div class="clear"></div>
										</div>
									</div>
								</div>
							</div>
							
						</div>
					</div>
				    
				</div>
				
			</div>
			
			<media-pagination page="friend_messages"></media-pagination>
			
			<div class="alert" ng-if="friend_messages.list.length <= 0">
				<span>当前没有空间动态</span>
			</div>
		</div>
		<!-- 我的说说 -->
		<div id="tab_my" class="tab-pane">
			<div class=" portfolio-text" ng-repeat="message in my_messages.list">
				<img ng-src="{{user.pic_url}}" alt="" class="user-pic">
				<div class="portfolio-text-info">
					<div class="msg">
						<a ui-sref="space({user_id:user.id})" ng-bind="message.sender_name"></a>：{{message.content}}
					</div>

					<div class="bottom">
						<span class="pull-left time"> {{message.create_time | diffDate}} · 浏览 {{message.browse_num}} 次 
							· 赞 {{message.vote_num}} 个
						</span> 
						<span class="pull-right">
							<a href="javascript:;" ng-click="myComment(message);" >评论({{message.comment_num}})</a> | 
							<a href="javascript:;" ng-click="deleteMessage(message);">删除</a>
						</span>
					</div>
					<div class="clear"></div>
					<div id="my_{{message.id}}" class="comment">
						
						<div class="comment-editable" id="myMsg{{message.id}}">
							<div class="editable" aria-label="写下你的评论…"  contenteditable="true" id="my_comment_editable{{message.id}}"></div>
							<div style="margin:2px 5px 0px 0px">
								<button class="btn green mini pull-right" ng-click="addComment(message,'my_comment_editable')">提交</button>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="comment-list" ng-repeat="comment in message.comments">
							<img ng-src="{{comment.sender_pic}}" alt="" class="user-pic pull-left">
							<div style="overflow:hidden;">
								<div class="comment-content">
									<a ui-sref="space({user_id:comment.sender_id})" target="_blank" ng-bind="comment.sender_name"></a>
									<span ng-if="comment.sender_id!=comment.receiver_id">
										@ <a ui-sref="space({user_id:comment.receiver_id})" target="_blank" ng-bind="comment.receiver_name"></a>
									</span>
									<br>
									<span ng-bind="comment.content"></span>
								</div>
								<div class="comment-opts">
									<span class="pull-left time">
										{{comment.create_time | diffDate}}
									</span>
									<span class="pull-right">
										<a href="javascript:;" ng-click="myReply(comment,message);" >[回复]</a> | 
									</span>
									<div id="my_reply_{{comment.id}}" class="comment" style="margin-top:25px;" >
										<div class="comment-editable">
											<div class="editable" aria-label="写下你的评论…"  contenteditable="true" id="my_comment_editable{{comment.id}}"></div>
											<div style="margin:2px 5px 0px 0px">
												<button class="btn green mini pull-right" ng-click="addReply(message,comment,user.id,'my_comment_editable')">回复</button>
											</div>
											<div class="clear"></div>
										</div>
									</div>
								</div>
							</div>
							
						</div>
					</div>
				    
				</div>
				
			</div>
			
			<media-pagination page="my_messages"></media-pagination>
			
			<div class="alert" ng-if="my_messages.list.length <= 0">
				<span>你还没有发过说说哦</span>
			</div>
		</div>
		<!-- 与我相关-->
		<div id="tab_about" class="tab-pane">
			<div class=" portfolio-text" ng-repeat="message in about_messages.list">
				<img ng-src="{{message.receiver_pic}}" alt="" class="user-pic">
				<div class="portfolio-text-info">
					<div class="msg">
						<a ui-sref="space({user_id:message.sender_id})" ng-bind="message.sender_name"></a>：{{message.content}}
					</div>

					<div class="bottom">
						<span class="pull-left time">
							 {{message.create_time | diffDate}}
						</span> 
						<span class="pull-right">
							<a href="javascript:;" ng-click="showDialogue(message);" >查看对话({{message.num}})</a> | 
						</span>
					</div>
					<div class="clear"></div>
					<div id="dialogue_{{message.id}}" class="comment">
						<div class="comment-list" ng-repeat="comment in message.comments">
							<img ng-src="{{comment.sender_pic}}" alt="" class="user-pic pull-left">
							<div style="overflow:hidden;">
								<div class="comment-content">
									<a ui-sref="space({user_id:comment.sender_id})" target="_blank" ng-bind="comment.sender_name"></a>
									<span ng-if="comment.sender_id!=comment.receiver_id">
										@ <a ui-sref="space({user_id:comment.receiver_id})" target="_blank" ng-bind="comment.receiver_name"></a>
									</span>
									<br>
									<span ng-bind="comment.content"></span>
								</div>
								<div class="comment-opts">
									<span class="pull-left time">
										{{comment.create_time | diffDate}}
									</span>
									<span class="pull-right">
										<a href="javascript:;" ng-click="replyDialog(comment,message);" >回复</a> | 
									</span>
									<!-- 回复编辑框 -->
									<div id="about_reply_{{comment.id}}" class="comment" style="margin-top:25px;" >
										<div class="comment-editable">
											<div class="editable" aria-label="写下你的评论…"  contenteditable="true" id="about_comment_editable{{comment.id}}"></div>
											<div style="margin:2px 5px 0px 0px">
												<button class="btn green mini pull-right" ng-click="addReply(message,comment,user.id,'about_comment_editable')">回复</button>
											</div>
											<div class="clear"></div>
										</div>
									</div>
								</div>
							</div>
							
						</div>
					</div>
				    
				</div>
			</div>
			
			<media-pagination page="about_messages"></media-pagination>
			
			<div class="alert" ng-if="about_messages.list.length <= 0">
				<span>当前没有相关动态</span>
			</div>
		</div>
		
		
	</div>
</div>
